/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.view;

import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.view.facelets.FaceletContext;
import mx.its.dsw2.biblioteca.Libro;
import mx.its.dsw2.biblioteca.bl.LibroBlLocal;

/**
 *
 * @author Piter
 */
@ManagedBean
@SessionScoped
public class AccessBean {
    

    private String user;
    private String password;
    
    /**
     * Creates a new instance of AccesoBean
     */
    public AccessBean() {
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    
    //____________________________ACTIONS___________________________
    public String procesarAcion(){
       
        
        if(user.equals("root")&&password.equals("12345")){
          FacesContext context = FacesContext.getCurrentInstance();
          context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", user);
          
          return "MenuPrincipal";
        }else{
            return "pagina2";
        }
    }

   
    
    
}
